/* eslint-disable no-undef */
import Vue from 'vue'
import VueRouter from 'vue-router'
import NotFound from '../views/Exception/NotFound'
Vue.use(VueRouter)

const routes = [{
  path: '/',
  name: '登录',
  component: resolve => require(['../views/Login'], resolve),
  hidden: true
},
{
  path: '/process/design', // 流程设计
  name: '流程设计',
  // component: resolve => require(['../views/DocumentCirculation/Design2'], resolve)
  component: resolve => require(['../views/DocumentCirculation/Design2'], resolve)
},
{
  path: '/err',
  component: NotFound
},
{
  path: '/home',
  name: '首页',
  component: resolve => require(['../views/Home'], resolve),
  redirect: '/welcome', // 重定向
  children: [
    {
      path: '/welcome', // 欢迎页
      name: '欢迎页',
      component: resolve => require(['../components/Welcome'], resolve)
    },
    {
      path: '/card', // 名片夹
      name: '名片夹',
      component: resolve => require(['../views/CardFile/CardFile'], resolve),
      children: [
        {
          path: '/Prodata',
          name: '个人资料',
          component: resolve => require(['../views/ProFile/pro-data'], resolve)
        },
        {
          path: '/Accountsetting',
          name: '账号设置',
          component: resolve => require(['../views/ProFile/account-setting'], resolve)
        },
        {
          path: '/Loginlog',
          name: '登录记录',
          component: resolve => require(['../views/ProFile/login-log'], resolve)
        },
        {
          path: '/Procards',
          name: '名片夹收藏',
          component: resolve => require(['../views/ProFile/pro-cards'], resolve)
        }
      ]
    },
    {
      path: '/daily', // 日程安排
      name: '日程安排',
      component: resolve => require(['../views/Schedule/Month1'], resolve)
    },
    {
      path: '/addrList', // 公司通讯录
      name: '公司通讯录',
      component: resolve => require(['../views/AddressBook/AddressBook'], resolve)
    },
    {
      path: '/todo', // 待办事项
      name: '待办事项',
      component: resolve => require(['../views/Todo/Todo'], resolve)
    },
    {
      path: '/room/equipment', // 会议室设施管理
      name: '会议室设施管理',
      component: resolve => require(['../views/MeetingRoomManagement/MeetingRoomDevice'], resolve)
    },
    {
      path: '/room/book', // 会议室预约审批
      name: '会议室预约审批',
      component: resolve => require(['../views/MeetingRoomManagement/MeetingRoomExamine'], resolve)
    },
    {
      path: '/room/info', // 会议室使用报表
      name: '会议室使用报表',
      component: resolve => require(['../views/MeetingRoomManagement/MeetingRoomUse'], resolve)
    },
    // {
    //   path: '/meeting/book', // 会议室预约与取消
    //   name: '会议室预约与取消',
    //   component: resolve => require(['../views/MeetingRoomManagement/MeetingRoomOC'], resolve)
    // },
    {
      path: '/meeting', // 会议管理
      name: '会议管理',
      component: resolve => require(['../views/MeetingManagement/MeetingManagement'], resolve)
    },
    {
      path: '/admin/department', // 部门管理
      name: '部门管理',
      component: resolve => require(['../views/BackstageManagement/DepartmentManage'], resolve)
    },
    {
      path: '/admin/emp', // 员工管理
      name: '员工管理',
      component: resolve => require(['../views/BackstageManagement/StaffManage'], resolve)
    },
    {
      path: '/admin/role', // 角色管理
      name: '角色管理',
      component: resolve => require(['../views/BackstageManagement/RoleManage'], resolve)
    },
    {
      path: '/admin/permission', // 权限管理
      name: '权限管理',
      component: resolve => require(['../views/BackstageManagement/PermissionManage'], resolve)
    },
    // {
    //   path: '/process/def', // 流程定义
    //   name: '流程定义',
    //   component: resolve => require(['../views/DocumentCirculation/Defines'], resolve)
    // },
    {
      path: '/doc/manage', // 公文管理
      name: '公文管理',
      component: resolve => require(['../views/DocumentCirculation/Docs'], resolve)
    },
    // {
    //   path: '/doc/setting', // 公文设置
    //   name: '公文设置',
    //   component: resolve => require(['../views/DocumentCirculation/DocumentSettings'], resolve)
    // },
    {
      path: '/doc/request', // 申请
      name: '申请',
      component: resolve => require(['../views/DocumentCirculation/Applys'], resolve)
    },
    {
      path: '/process/def', // 流程定义
      name: '流程定义',
      component: resolve => require(['../views/DocumentCirculation/Defines'], resolve)
    },
    {
      path: '/log/login', // 日志处理
      name: '日志处理',
      component: resolve => require(['../views/Log/Log'], resolve)
    }
    // {
    //   path: '/process/design', // 流程设计
    //   name: '流程设计',
    //   component: resolve => require(['../views/DocumentCirculation/Design2'], resolve)
    // // }
    // {
    //   path: '/err',
    //   component: NotFound
    // }
    // {
    //   path: '*',
    //   redirect: '/404'
    // }

  ]
}
]

const router = new VueRouter({
  routes
})

export default router
